import React, { useState, useEffect } from 'react'
import { useHttpHook } from '@/hooks'

import Header from './components/header'
import Search from './components/Search'
import Hot from './components/Hot'

import './index.less'

const home: React.FC = (props: any) => {
    const [houses, housesLoading] = useHttpHook({
        url: '/house/hot',
        method: 'POST'
    })

    const [citys, citysLoading] = useHttpHook({
        url: '/common/citys',
        method: 'POST'
    })

    return (
        <div className="home">
            {/* 头部 */}
            <Header />
            {/* 搜索 */}
            <Search citys={citys} citysLoading={citysLoading} />
            {/* 主体 */}
            <Hot houses={houses} />
        </div>
    )
}

export default home